import { BasicColumn, FormSchema } from '@apps/antd-admin/src/components/table';
import { RenderType } from '@pkg/setting';

export const columns: BasicColumn[] = [
  {
    title: '会员姓名',
    dataIndex: 'userName',
    width: 80,
  },
  {
    title: '手机号',
    dataIndex: 'mobile',
    width: 100,
  },
  {
    title: '会员卡号',
    dataIndex: 'vipCardNo',
    width: 140,
  },
  {
    title: '卡种名称',
    dataIndex: 'vipCardGoodsName',
    width: 130,
  },
  {
    title: '商品名称',
    dataIndex: 'goodsName',
    width: 140,
  },
  {
    title: '兑换数量',
    dataIndex: 'exchangeNum',
    width: 90,
  },
  {
    title: '支付状态',
    dataIndex: 'elePayStatus',
    width: 120,
    dictData: [
      { label: '未支付', value: 'PAY_0' },
      { label: '已支付', value: 'PAY_1' },
      { label: '已退款', value: 'PAY_2' },
    ],
    renderType: RenderType.DICT,
  },
  {
    title: '电子金',
    dataIndex: 'useEleAmount',
    width: 80,
  },
  {
    title: '生成状态',
    dataIndex: 'generateState',
    width: 120,
    dictData: [
      { label: '已生成', value: 1 },
      { label: '未生成', value: 0 },
    ],
    renderType: RenderType.DICT,
  },
  {
    title: '备注',
    dataIndex: 'remark',
    width: 150,
  },
  {
    title: '提交人',
    dataIndex: 'submitUserName',
    width: 100,
  },
  {
    title: '创建日期',
    dataIndex: 'createTime',
    width: 150,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'userName',
    label: '会员姓名',
    component: 'Input',
    colProps: { span: 4 },
  },
  {
    field: 'mobile',
    label: '手机号',
    component: 'Input',
    colProps: { span: 4 },
  },
  {
    field: 'vipCardNo',
    label: '会员卡号',
    component: 'Input',
    colProps: { span: 4 },
  },
  {
    field: 'goodsName',
    label: '商品名称',
    component: 'Input',
    colProps: { span: 4 },
  },
  {
    field: 'elePayStatus',
    label: '支付状态',
    component: 'Select',
    colProps: { span: 6 },
    componentProps: {
      options: [
        { label: '未支付', value: 'PAY_0' },
        { label: '已支付', value: 'PAY_1' },
        { label: '已退款', value: 'PAY_2' },
      ],
    },
  },
  {
    field: 'generateState',
    label: '生成状态',
    component: 'Select',
    colProps: { span: 6 },
    componentProps: {
      options: [
        { label: '未生成', value: 0 },
        { label: '已生成', value: 1 },
      ],
    },
  },
  {
    field: 'startDate',
    label: '开始日期',
    component: 'DatePicker',
    colProps: { span: 5 },
    componentProps: {
      valueFormat: 'YYYY-MM-DD',
      format: 'YYYY-MM-DD',
    },
  },
  {
    field: 'endDate',
    label: '结束日期',
    component: 'DatePicker',
    colProps: { span: 5 },
    componentProps: {
      valueFormat: 'YYYY-MM-DD',
      format: 'YYYY-MM-DD',
    },
  },
];

export const formSchema: FormSchema[] = [];
